﻿<UserControl x:Class="Core.Features.Results.UserResults"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ctrl="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    mc:Ignorable="d" d:DesignHeight="365" d:DesignWidth="480">
    <Grid x:Name="LayoutRoot">
        <Path Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" 
                      StrokeThickness="2" Fill="DarkGray" Grid.ColumnSpan="2" Grid.RowSpan="2"
		                Data="F1 M 243,89.3333L 538.46,89.3333L 538.46,256.138L 286.667,256.139L 288,280.833L 269.675,256.138L 242.987,256.138L 243,89.3333 Z " 
		                Margin="8" UseLayoutRounding="False"/>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid Grid.ColumnSpan="2" Margin="10">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <RadioButton Grid.Column="0" IsChecked="{Binding IsScoresChecked, Mode=TwoWay}" Content="Scores" />
                <RadioButton Grid.Column="1" IsChecked="{Binding IsJounralChecked, Mode=TwoWay}" Content="Journals" />
            </Grid>
            <ctrl:Pivot x:Name="MainPivot" Grid.Row="1" SelectionChanged="MainPivot_OnSelectionChanged"
                    SelectedIndex="{Binding SelectedPivot}" >
                <ctrl:PivotItem>
                    <Grid>
                        <ListBox  ItemsSource="{Binding ScoreResultsList}" Margin="10,10,10,56">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding}" />
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </Grid>
                </ctrl:PivotItem>
                <ctrl:PivotItem>
                    <Grid>
                        <ListBox  ItemsSource="{Binding JournalArchieves}" Margin="10,10,10,56">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding}" TextWrapping="Wrap" />
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </Grid>
                </ctrl:PivotItem>
            </ctrl:Pivot>
        </Grid>
        <Button Content="X" Grid.ColumnSpan="2"  FontSize="15"
                HorizontalAlignment="Right" VerticalAlignment="Top" Margin="10"
                Command="{Binding CmdFinished}"/>
    </Grid>
</UserControl>
